<% layout('/layout/default.html', {title: '登录', libs: ['validate', 'login'], bodyClass: 'hold-transition login-page'}){ %>
<% var productName = @Global.getProperty('productName'), productVersion = @Global.getProperty('version'); %>
<div class="login-box">
    <div class="login-logo">
        <h1 style="margin-bottom: 1.5rem;">${productName} <small>${productVersion}</small></h1>
    </div>
    <!-- /.login-logo -->
    <div class="card">
        <div class="login-card-body">
            <form id="loginForm"  action="${ctx}/login" method="post">
                <div class="input-group mb-3">
                    <input name="username" class="form-control" type="text" data-msg-required="${i18n('请填写登录账号')}"
                           placeholder="${i18n('登录账号')}" >
                    <div class="input-group-append">
                        <div class="input-group-text">
                            <span class="fas fa-envelope"></span>
                        </div>
                    </div>
                </div>
                <div class="input-group mb-3">
                    <input name="password" class="form-control" type="password" data-msg-required="${i18n('请填写登录密码')}"
                           placeholder="${i18n('登录密码')}" >
                    <div class="input-group-append">
                        <div class="input-group-text">
                            <span class="fas fa-lock"></span>
                        </div>
                    </div>
                </div>
                <div id="isValidCodeLogin" style="display:${isValidateCodeLogin?'blank':'none'}">
                    <#form:validcode name="validateCode" />
                </div>
                <div class="row ">
                    <div class="col-12 mb-3">
                        <label title="${i18n('公共场所慎用,下次不需要再填写帐号和密码')}">
                            <input type="checkbox" name="rememberMe" data-style="square-blue">&nbsp;${i18n('记住密码')}
                        </label>
                    </div>
                </div>
                <div class="row">
                    <div class="col-12">
                        <button id="btnSubmit" type="submit" class="btn btn-primary btn-block " type="button">${i18n('立即登录')}</button>
                    </div>
                </div>
            </form>
            <div class="row">
                <div class="col-6 text-left">
                    <button class="btn btn-link px-0" type="button">[ ${i18n('忘记密码')} ]</button>
                </div>
                <div class="col-6 text-right">
                    <% if (@com.jsite.common.i18n.I18nLocaleResolver.enabled()){ %>
                    <li class="nav-item dropdown ml-auto">
                        <a href="javascript:" class="f1rem" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <i class="fa icon-globe"></i> ${@DictUtils.getDictLabel(lang(), 'sys_lang_type', '简体中文')}
                        </a>
                        <div class="dropdown-menu dropdown-menu-right">
                            <% for(var dict in @DictUtils.getDictList('sys_lang_type')){ %>
                            <a href="${ctx}/login?lang=${dict.value}" class="dropdown-item">${dict.label}</a>
                            <% } %>
                        </div>
                    </li>
                    <% } %>
                </div>
            </div>
        </div>
        <!-- /.login-card-body -->
    </div>

    <div class="text-foot">
        &copy; ${@DateUtils.getYear()} ${productName} - Powered By <a href="http://jsite.org.cn">JSite</a>
    </div>
</div>
<% } %>